from flask import Flask
from config import config
from .lab import lab as lab_blueprint
from .auth import auth as auth_blueprint

def create_app(config_name):
    app = Flask(__name__)
    app.config.from_object(config[config_name])
    config[config_name].init_app(app)

    app.register_blueprint(lab_blueprint, url_prefix='/lab')
    app.register_blueprint(auth_blueprint, url_prefix='/auth')

    return app
